package com.zanglikun.activity.util;

/**
 * @author : zanglikun
 * @date : 2025/10/31 14:31
 * @desc : Copyright © zanglikun.com
 */
public class CreateOrderActivity  implements Activity {
    @Override
    public boolean execute(ActivityContext context) {
        System.out.println("【生成订单】开始生成订单...");
        double totalPrice = (Double) context.get("totalPrice");

        String orderNo = "ORD-" + System.currentTimeMillis();
        context.put("orderNo", orderNo);

        System.out.println("【生成订单】✓ 订单号: " + orderNo + ", 金额: " + totalPrice);
        return true;
    }

    @Override
    public String getName() {
        return "CreateOrderActivity";
    }
}